package org.fullhappy.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author caohonghiep
 */
@Entity
@Table(name = "ebook_format")
@XmlRootElement
public class EbookFormat implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "format_id")
    private Long formatId;
    @Column(name = "title")
    private String title;

    public EbookFormat() {
    }

    public EbookFormat(Long formatId) {
        this.formatId = formatId;
    }

    public EbookFormat(Long formatId, String title) {
        this.formatId = formatId;
        this.title = title;
    }

    public Long getFormatId() {
        return formatId;
    }

    public void setFormatId(Long formatId) {
        this.formatId = formatId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (formatId != null ? formatId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EbookFormat)) {
            return false;
        }
        EbookFormat other = (EbookFormat) object;
        if ((this.formatId == null && other.formatId != null) || (this.formatId != null && !this.formatId.equals(other.formatId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.fullhappy.entity.EbookFormat[ formatId=" + formatId + " ]";
    }
}
    
